import { defineStore } from "pinia";
import { ref } from "vue";
import { getAppInfo, getSystemInfo } from "@/utils/utils";

/**
 * APP信息 活动时间等
 * @description appInfo store
 * @example
 * const { ui, activityStartTime, activityEndTime, getAppInfos, appUI } = useAppInfoStore();
 */
export const appInfoStore = defineStore("appInfo", () => {
  const appInfo = ref(getAppInfo());
  const systemInfo = ref(getSystemInfo());
  const isH5 = ref(process.env.TARO_ENV === "h5")
  const token = ref("");

  const globalQuery = ref<Record<string, any>>({});

  return {
    token,
    globalQuery,
    systemInfo,
    appInfo,
    isH5
  };
});
